package com.pwc.topic;

import com.pwc.utils.RabbitUtil;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class ProductLog {
    public static final String EXCHANGE_NAME = "topic_logs";

    public static void main(String[] args) throws IOException, TimeoutException {
        Channel channel = RabbitUtil.makeChannel();
        channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.TOPIC);
        for (int i = 0; i < 5; i++) {
            String msg = "消息==" + i;
            channel.basicPublish(EXCHANGE_NAME, "lazy.orange.yellow", null, msg.getBytes());
        }
    }
}
